<link type="text/css" rel="stylesheet" href="<?php echo $this->assetDirWeb ?>css/Webmaster/user.css" />
<link type="text/css"  rel="stylesheet" href="<?php echo $this->assetDirWeb ?>css/Webmaster/schedules.css">
<div class="row-fluid">
    <div class="box span12">
        <?php
        /* @var $this RequestBookingController */
        /* @var $model RequestBooking */
        /* @var $form CActiveForm */


        //    $this->breadcrumbs=array(
        //        'Request Bookings'=>array('index'),
        //        'Manage',
        //    );
        //    $this->menu=array(
        //        array('label'=>'List RequestBooking', 'url'=>array('index')),
        //        array('label'=>'Create RequestBooking', 'url'=>array('create')),
        //    );

        Yii::app()->clientScript->registerScript('search', "
    $('.search-button').click(function(){
        $('.search-form').toggle();
        return false;
    });
    $('.search-form form').submit(function(){
        $('#subscription-grid').yiiGridView('update', {
            data: $(this).serialize()
        });
        return false;
    });
    ");
        ?>
        <div class="box-header" data-original-title>
            <h2>
                <i class="icon-user"></i><span class="break"></span>
                Subscription List
            </h2>
        </div>

        <div class="box-content search-form">
            <!--            Search content-->
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'action' => Yii::app()->createUrl($this->route),
                'method' => 'get',
            ));
            ?>

            <input  type="text" placeholder= "Subscriber Email " name="subs_email"
                    value="<?php echo isset($_GET['subs_email']) ? $_GET['subs_email'] : '' ?>">


            <?php //echo CHtml::submitButton('search',array('class'=>'btn btn-success'));  ?>
            <input id="search" class="btn btn-success" type="submit" value="search">
            <?php $this->endWidget(); ?>
            <!--            End Search content-->

        </div>



        <?php
        $this->widget('zii.widgets.grid.CGridView', array(
            'id'            => 'subscription-grid',
            'dataProvider'  => $model->search(),
            'filter'        => false,
            'summaryText'   => '',
            'itemsCssClass' => 'table table-bordered table-striped table-condensed schedules-table',
            'pagerCssClass' => 'pagination pagination-centered',
            'pager'         => array(
                'header'               => '',
                'maxButtonCount'       => 5,
                'nextPageLabel'        => '&raquo;',
                'firstPageLabel'       => '←',
                'lastPageLabel'        => '→',
                'prevPageLabel'        => '&laquo;',
                'selectedPageCssClass' => 'active',
            ),
            'htmlOptions'   => array(
                'class' => 'box-content table-responsive'
            ),
            'columns'       => array(
                array(
                    'name'   => 'email',
                    'filter' => false,
                ),
                array(
                    'name'   => 'ip_subscription',
                    'filter' => false,
                ),
//                //'status',
//                array(
//                    'name'=>'status',
//                    'filter'=>false,
//                ),
                array(
                    'name'        => 'create_time',
                    'type'        => 'raw',
                    'filter'      => false,
                    'value'       => 'date("l jS \of F Y h:i:s A",$data->create_time)',
                    'htmlOptions' => array(
                        'width' => '10%'
                    ),
                ),
                array(
                    'class'       => 'CButtonColumn',
                    'template'    => '{update}',
                    'htmlOptions' => array(
                        'width' => '10%'
                    ),
                    'buttons'     => array(
                        'update' => array(
                            //'url'=>'#',
                            'imageUrl' => false,
                            'label'    => '<i class="icon-edit "></i>',
                            'options'  => array(
                                'class' => 'btn btn-info',
                            //'onClick'=>'return editItem($(this))',
                            ),
                        ),
                    ),
                ),
            ),
        ));
        ?>
        <!--    </div>-->
    </div>
</div>
<?php
$css  = ".filters input {margin-bottom: 0px ;padding: 0px;max-width: 100px;}";
cs()->registerCss("#" . uniqid(), $css);

